<?php
namespace Addons\Attach;
use Common\Controller\Addon;

class AttachAddon extends Addon {
    protected $admin_menu = array(
        array(
            'title' => '附件管理',
            'name' => 'Attach/Index/index',
            'type' => 2,
            'module' => 'Admin',
            'remark' => '附件管理',
            'icon' => 'fa fa-chain',
            'function'=>'addon_url',
        ),
    );
    public function register_hook()
    {
        return [];
    }
    public function install(){
        return true;
    }
    public function uninstall(){
        $map = array('code'=>'attach_addon');
        $this->delete_menu($map);
        return true;
    }
    public function start($status){
        if($status==1) {
            $this->create_menu($this->admin_menu, 0, 'attach_addon');
        }else {
            $map = array('code'=>'attach_addon');
            $this->delete_menu($map);
        }
        return true;
    }
}
